home *** CD-ROM | disk | FTP | other *** search
/ Zoom 2 / Zoom - Release 2 (1996)(Active Software)[!].iso / programming / amos / amossible / structures / loopy.bak / loopy.amosSourceCode
Encoding:
AMOS Source Code  |  1980-05-17  |  1.3 KB  |  29 lines

  1. '*****************YOU SPIN ME ROUND,ROUND-By Mark Wickson********************* 
  2. Rem You may be wondering what a loop is.In computer terms it is a piece of 
  3. Rem a program that constantly repeats itself.Why do you need something to
  4. Rem repeat itself?Well,imagine you had a game,and the player controlled a
  5. Rem Bob/Sprite's position with the joystick-Since you can't predict exactly
  6. Rem when the person is going to do anything and you would want the computer
  7. Rem to keep checking for any movement,you must use one of the many 
  8. Rem "Loop" structures.Obviously,you can put anything that you want done  
  9. Rem repeatedly in a loop-Remembering that the more you put into a loop,the 
  10. Rem longer it takes to go through it.  
  11. Rem This particular sort of loop uses the commands "Do" and "Loop".
  12. Rem When you want your loop to start,you type  
  13. Rem Do 
  14. Rem Then after this you put as many lines of program code as you 
  15. Rem want-When you have all you want,type(On the start of a new line):
  16. Rem Loop 
  17. Rem This makes the program return to the "Do" command written earlier,and then 
  18. Rem start reading commands from there. 
  19. Rem In our example,we display some text,make AMOS wait a fraction of a 
  20. Rem second and then return to the start of the loop. 
  21. Screen Open 0,320,256,4,Lowres
  22. Flash Off 
  23. Curs Off 
  24. Cls 0
  25. Paper 0
  26. Do 
  27. Print "GOING DOWN!"
  28. Wait 5
  29. Loop